package com.salt.admin.api.feign.client;

import com.salt.admin.api.feign.hystrix.MenuClientHystrix;
import com.salt.admin.api.feign.interceptor.FeignTokenInterceptor;
import com.salt.admin.api.model.Menu;
import com.salt.common.constant.Common;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Description
 * @Author salt
 * @Date 2020/6/18 15:12
 * @Version 1.0
 */
@FeignClient(name = Common.Service.SALT_ADMIN_SERVICE_NAME,
        path = Common.Service.SALT_ADMIN_MENU_URL_PREFIX,
        fallbackFactory = MenuClientHystrix.class,
        configuration = FeignTokenInterceptor.class)
public interface MenuClient {

    @PostMapping("save")
    public void saveMenu(Menu menu);

    @GetMapping("findAll")
    public List<Menu> findAllMenu();


}
